*Make UI_schmieder program assumption files
*Last modified: 4/2/19
*Last modified by: Harris Eppsteiner
*Description: 	Generate MVPF calculation assumption files for the two UI_schmieder
*				do-files.

clear all

******* 1. SET FILEPATHS AND DECLARE ASSUMPTIONS *******
local assumptions_set "baseline" //"baseline" or "full"
local program_assumptions "/Users/Harris_Eppsteiner/Dropbox/Children/MVPF_Calculations/program_assumptions/"


******* 2. SOURCES FOR CONSUMPTION-DROP ESTIMATES *******
#delimit ;

#delimit cr

******* 3. SOURCES FOR FE ESTIMATES (BENEFITS) *******
#delimit ;
local FE_estimates_b		"	solon
								katz_meyer
								meyer_tob
								meyer_lo
								meyer_hi
								chetty
								landais
								kroft_noto
								card_rec
								card_exp
								";
#delimit cr

******* 3. SOURCES FOR FE ESTIMATES (EXTENSIONS) *******
#delimit ;
local FE_estimates_e		 "	katz_meyer
								johnston
								";
#delimit cr

******* 4. OTHER PROGRAM PARAMETERS *******
if "`assumptions_set'" == "baseline" {
	#delimit ;
	local rra_coeffs	"	2
						";
	local FE_assumptions "	full
						";
	local scale_WTPs 	"	yes
						";
	local cons_estimates "
							gruber
						";
	local incl_DIs		"
							yes
							no
						";
	#delimit cr
}
if "`assumptions_set'" == "full" {
	#delimit ;
	local rra_coeffs	"	2
							5
						";
	local FE_assumptions "	full
							pay						
						";
	local scale_WTPs 	"	yes
							no
						";
	local cons_estimates "	gruber
							cochrane
							stephens
							chetty_szeidl
							roth_vall_2001
							roth_vall_2008
							kroft_noto
							ganong_noel
							";					
	#delimit cr
}

******* 5. WRITE PROGRAM ASSUMPTIONS FILES *******
foreach policy in b e {
	foreach FE_source in `FE_estimates_`policy'' {	
	
		clear
		foreach var in FE_source cons_source rra_coeff scale_WTP FE_assumption incl_DI DI_disp DI_incl_med discount_rate  {
			gen `var' = ""
		}

		set obs 1
		foreach cons_source in `cons_estimates' {
			foreach rra_coeff in `rra_coeffs' {
				foreach scale_WTP in `scale_WTPs' {
					foreach FE_assumption in `FE_assumptions' {
						foreach incl_DI in `incl_DIs' {
					
							replace FE_source 		= "`FE_source'"		if _n==_N
							replace cons_source 	= "`cons_source'"	if _n==_N
							replace rra_coeff 		= "`rra_coeff'" 	if _n==_N
							replace FE_assumption 	= "`FE_assumption'"	if _n==_N
							replace scale_WTP		= "`scale_WTP'"		if _n==_N
							replace incl_DI			= "`incl_DI'"		if _n==_N
							replace DI_disp			= "1"				if _n==_N
							replace DI_incl_med		= "yes"				if _n==_N
							replace discount_rate	= "0.03"			if _n==_N

							local plusone = _N+1
							set obs `plusone'
						}
					}
				}
			}
		}
	
		drop if cons==""
		destring _all, replace
	
		export excel using "`program_assumptions'/UI_`policy'_`FE_source'.xlsx", replace first(var)
	}
}
